import React from 'react';
import cx from 'classnames';
import styles from './common.less';

interface ViewProps extends React.HTMLAttributes<HTMLDivElement> {
  type?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'small' | 'mini';
}

const Text = ({ className, type, ...props }: ViewProps) => {
  return (
    <span
      className={cx(
        styles.text,
        {
          [styles[type || '']]: !!type,
        },
        className,
      )}
      {...props}
    />
  );
};

Text.defaultProps = {};

export { Text };
